<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>设置</title>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>

    <link rel="stylesheet" href="../js/libs/sui/sm.min.css">
    <link rel="stylesheet" href="../js/libs/sui/sm-extend.min.css">
    <link rel="stylesheet" href="../iconfont/iconfont.css">
    <link rel="stylesheet" href="../less/main.css"/>

    <script type="text/javascript" src='../js/libs/jquery-3.1.0.min.js' charset='utf-8'></script>
    <script type="text/javascript">
        var Zepto = jQuery;
    </script>
    <script type="text/javascript" src='../js/libs/sui/sm.js' charset='utf-8'></script>
    <script type="text/javascript" src='../js/libs/sui/sm-extend.min.js' charset='utf-8'></script>
    <script type="text/javascript" src="../js/libs/juicer-min.js"></script>
    <script type="text/javascript" src="../js/libs/jquery.md5.js"></script>
    <script type="text/javascript" src="../js/api.js"></script>
    <script type="text/javascript" src="../js/utils.js"></script>
    <script type="text/javascript" src="../js/common.js"></script>
</head>
<body>
<!-- 这里是页面内容区 -->
<div class="content native-scroll p-t22">
    <!--我的班级-->
    <!-- 头部-->
    <div class="head-no-toolbar bg-self-green no-left-icon">
        <span class="icon iconfont c-white p-l" onclick="javascript:closeWin();">&#xe61f;</span>
        <span class="c-white t-center">设置</span>
    </div>

    <!--内容区-->
    <div class="self-scroll">
        <div class="my-list-block" style="margin-top: 3.2rem;">
            <ul>
                <li class="bg9" id="update-pwd">
                    <span class="my-item-title">密码修改</span>
                </li>
                <li class="bg16" id="my-info">
                    <span class="my-item-title">个人信息</span>
                </li>
                <li id="my-advise" class="bg10">
                    <span class="my-item-title">意见反馈</span>
                </li>
                <li class="openaboutbms bg12">
                    <span class="my-item-title">关于百马树教育</span>
                </li>
            </ul>
        </div>
        <div class="my-list-block">
            <ul>
                <li id="logout-li" class="bg11">
                    <span class="my-item-title">退出</span>
                </li>
            </ul>
        </div>
    </div>
    <!--<div class="list-block set-ul-b">-->
        <!--<ul>-->
            <!--<li id="update-pwd" class="item-content item-link p-l-0">-->
                <!--<a class="c-normal add-link my-focus-load"  progress="false">-->
                    <!--<div class="item-media"><i class="iconfont icon c-beau-green set-icon1">&#xe61e;</i></div>-->
                    <!--<div class="item-inner">-->
                        <!--<div class="item-title">密码修改</div>-->
                    <!--</div>-->
                <!--</a>-->
            <!--</li>-->
            <!--<li id="my-info" class="item-content item-link p-l-0">-->
                <!--<a class="c-normal add-link my-pay-log"  progress="false">-->
                    <!--<div class="item-media"><i class="iconfont icon c-beau-green set-icon">&#xe605;</i></div>-->
                    <!--<div class="item-inner">-->
                        <!--<div class="item-title">个人信息</div>-->
                    <!--</div>-->
                <!--</a>-->
            <!--</li>-->
        <!--</ul>-->
    <!--</div>-->
    <!--<div class="list-block set-ul-b">-->
        <!--<ul>-->
            <!--<li class="item-content item-link p-l-0">-->
                <!--<a class="c-normal add-link my-focus-load openaboutbms" load="public/pages/Duer/my-focus.html" progress="false">-->
                    <!--<div class="item-media"><i class="iconfont icon c-beau-green set-icon">&#xe623;</i></div>-->
                    <!--<div class="item-inner">-->
                        <!--<div class="item-title">关于百马树教育</div>-->
                    <!--</div>-->
                <!--</a>-->
            <!--</li>-->
            <!--<li id="logout-li" class="item-content item-link p-l-0" style="display: none;">-->
                <!--<a id="logout-btn" class="c-normal add-link my-pay-log" href="javascript:void(0);" progress="false">-->
                    <!--<div class="item-media"><i class="iconfont icon c-beau-green set-icon">&#xe622;</i></div>-->
                    <!--<div class="item-inner">-->
                        <!--<div class="item-title">退出</div>-->
                    <!--</div>-->
                <!--</a>-->
            <!--</li>-->
        <!--</ul>-->
    <!--</div>-->
</div>

<script type="text/javascript">
    apiready = function () {
        juicer.set({
            'tag::operationOpen': '{@',
            'tag::operationClose': '}',
            'tag::interpolateOpen': '&{',
            'tag::interpolateClose': '}',
            'tag::noneencodeOpen': '$${',
            'tag::noneencodeClose': '}',
            'tag::commentOpen': '{#',
            'tag::commentClose': '}',
            'strip': false,
            'cache': false
        });

        //点击行高亮
        $(".my-list-block li").on("touchstart",function(){
            $(this).css("background-color","#EEEEEE");
        });
        $(".my-list-block li").on("touchend",function(){
            $(this).css("background-color","#fff");
        });
        //滑动也高亮
        $(".my-list-block li").on("touchmove",function(){
            $(this).css("background-color","#fff");
        });
        // 如果已经登录，显示退出按钮
        if (isLogin()) {
            $("#logout-li").css("display", "flex");

            // 否则，隐藏退出按钮
        } else {
            $("#logout-li").css("display", "none");
        }

        // 修改密码
        $("#update-pwd").click(function() {
            if(isLogin()){
                openWin("modify-password", "modify-password.html", null);
            }else{
                toLogin();
            }
        });
        // 查看个人信息
        $("#my-info").click(function() {
            if(isLogin()){
                openWin("person-info", "person-info.html", null);
            }else{
                toLogin();
            }
        });

        // 点击退出
        $("#logout-li").click(function() {
            comfirmshow("确定退出吗？", function (ret, err) {
                if (ret.buttonIndex == 1) {
                    // 退出
                    logout();
                    // 关闭设置窗口
                    closeWin();
                }
            });
        });

        //意见反馈
        $("#my-advise").click(function () {

            openWin("my-advise", "my-advise.html", null);

        });

//        点击查看百马树教育信息
        $(".openaboutbms").click(function() {
            if(isLogin()){
                openWin("aboutBMS", "aboutBMS.html", null);
            }else{
                toLogin();
            }
        });

        // 监听登录事件
        api.addEventListener({
            name: "loginEvent"
        }, function(ret, err) {
            // 显示退出按钮
            $("#logout-li").css("display", "flex");
        });

        //监听密码修改事件
        api.addEventListener({
            name:"changePwdEvent"
        },function(){
            // 隐藏退出按钮
            $("#logout-li").css("display", "none");
        })
    };
</script>

</body>
</html>
